Constructs for Handling Multiple Values

Normally multiple values are not used. Special forms are required both to <#2939#>produce<#2939#> multiple values and to <#2940#>receive<#2940#> them. If the caller of a function does not request multiple values, but the called function produces multiple values, then the first value is given to the caller and all others are discarded; if the called function produces zero values, then the caller gets <#2941#><#2941#> as a value.

The primary primitive for producing multiple values is <#2942#>values<#2942#>, which takes any number of arguments and returns that many values. If the last form in the body of a function is a <#2943#>values<#2943#> with three arguments, then a call to that function will return three values. Other special forms also produce multiple values, but they can be described in terms of <#2944#>values<#2944#>. Some built-in Common Lisp functions, such as <#2945#>floor<#2945#>, return multiple values; those that do are so documented.

The special forms and macros for receiving multiple values are as follows:
#lisp2946#
These specify a form to evaluate and an indication of where to put the values returned by that form.


#defun2948#


#defun2965#


#defun2970#


#defmac2980#


#defspec2988#


#defspec3000#


#defmac3009#


#defmac3021#


#new3042#